//
// CZoneSymmetrisation.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CZoneSymmetrisation {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CZoneSymmetrisation(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CZoneSymmetrisation obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CZoneSymmetrisation(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CZoneSymmetrisation() {
    this(nel3dJNI.new_CZoneSymmetrisation(), true);
  }

  public CZoneSymmetrisation.TState getTileState(long patch, long tile, long layer) {
    return CZoneSymmetrisation.TState.swigToEnum(nel3dJNI.CZoneSymmetrisation_getTileState(swigCPtr, this, patch, tile, layer));
  }

  public CZoneSymmetrisation.TState getTileBorderState(long patch, long tile) {
    return CZoneSymmetrisation.TState.swigToEnum(nel3dJNI.CZoneSymmetrisation_getTileBorderState(swigCPtr, this, patch, tile));
  }

  public CZoneSymmetrisation.TState getOrientedTileBorderState(long patch, long tile) {
    return CZoneSymmetrisation.TState.swigToEnum(nel3dJNI.CZoneSymmetrisation_getOrientedTileBorderState(swigCPtr, this, patch, tile));
  }

  public boolean getOrientedTileCorner(long patch, long tile) {
    return nel3dJNI.CZoneSymmetrisation_getOrientedTileCorner(swigCPtr, this, patch, tile);
  }

  public boolean build(SWIGTYPE_p_std__vectorT_NL3D__CPatchInfo_t patchInfo, float snapCell, float weldThreshold, CTileBank bank, SWIGTYPE_p_NL3D__CZoneSymmetrisation__CError errorDesc, SWIGTYPE_p_NLMISC__CMatrix toOriginalSpace) {
    return nel3dJNI.CZoneSymmetrisation_build(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CPatchInfo_t.getCPtr(patchInfo), snapCell, weldThreshold, CTileBank.getCPtr(bank), bank, SWIGTYPE_p_NL3D__CZoneSymmetrisation__CError.getCPtr(errorDesc), SWIGTYPE_p_NLMISC__CMatrix.getCPtr(toOriginalSpace));
  }

  public final static class TState {
    public final static TState Nothing = new TState("Nothing", nel3dJNI.CZoneSymmetrisation_Nothing_get());
    public final static TState Regular = new TState("Regular", nel3dJNI.CZoneSymmetrisation_Regular_get());
    public final static TState Goofy = new TState("Goofy", nel3dJNI.CZoneSymmetrisation_Goofy_get());

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TState swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TState.class + " with value " + swigValue);
    }

    private TState(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TState(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TState(String swigName, TState swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TState[] swigValues = { Nothing, Regular, Goofy };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
